﻿Imports System.ServiceModel
Imports System.IO

' NOTE: If you change the class name "IWelcome" here, you must also update the reference to "IWelcome" in Web.config.
<ServiceContract()> _
Public Interface IWelcome

    <OperationContract()> _
    Function Hello(ByVal clientMajorVersion As Integer, ByVal clientMinorVersion As Integer, ByVal clientPatch As Integer) As IdentificationType
    <OperationContract()> _
    Function GetFile(ByVal filename As String) As Stream
    <OperationContract()> _
    Function GetFiles(ByVal token As String) As String
    <OperationContract()> _
    Function PutFile(ByVal uploadStream As Stream) As String
    <OperationContract()> _
    Function PreloadFile(ByVal token As String, ByVal filename As String, ByVal size As Long) As String
    <OperationContract()> _
    Function DeleteFile(ByVal token As String, ByVal filename As String) As String

End Interface

<DataContract()> _
Public Class IdentificationType
    Private _serverVersion As String
    Private _resultCode As Integer
    Private _message As String = ""
    Private _updateRequired As Boolean

    <DataMember()> _
    Public Property ServerVersion() As String
        Get
            Return _serverVersion
        End Get
        Set(ByVal value As String)
            _serverVersion = value
        End Set
    End Property

    <DataMember()> _
    Public Property UpdateRequired() As Boolean
        Get
            Return _updateRequired
        End Get
        Set(ByVal value As Boolean)
            _updateRequired = value
        End Set
    End Property

    <DataMember()> _
    Public Property ResultCode() As Integer
        Get
            Return _resultCode
        End Get
        Set(ByVal value As Integer)
            _resultCode = value
        End Set
    End Property

    <DataMember()> _
    Public Property Message() As String
        Get
            Return _message
        End Get
        Set(ByVal value As String)
            _message = value
        End Set
    End Property

End Class